package priv.wjh.study.nacos;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Timer;

/**
 * //TODO
 *
 * @author wangjunhao
 **/
@EnableDiscoveryClient(autoRegister = true)
@EnableConfigurationProperties(MyConfig.class)
@SpringBootApplication
public class NacosStudyApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(NacosStudyApplication.class, args);
        MyConfig myConfig = configurableApplicationContext.getBean(MyConfig.class);

        while (true){
            Thread.sleep(2000);
            System.out.println(myConfig);
        }
    }


}
